package cn.yuan.xiaoyu.testmodule.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import butterknife.Bind;
import butterknife.OnClick;
import cn.yuan.xiaoyu.R;
import cn.yuan.xiaoyu.commonmodule.activity.BaseActivity;
import cn.yuan.xiaoyu.commonmodule.utils.StatusBarCompatUtils;
import cn.yuan.xiaoyu.testmodule.view.WeiBoMorePoPuWindow;

/**
 * Created by yukuoyuan on 2017/3/28.
 * 这是一个测试一些控件的界面
 */

public class TestActivity extends BaseActivity {
    @Bind(R.id.iv_toolbar_left)
    ImageView ivToolbarLeft;
    @Bind(R.id.tv_toolbar_title)
    TextView tvToolbarTitle;
    private Intent intent;

    @Override
    protected void bindPresenter() {

    }

    @Override
    protected void initData(Bundle extras) {

    }

    @Override
    public int getContentLayout() {
        return R.layout.activity_test;
    }

    @Override
    protected void initToolbar() {
        StatusBarCompatUtils.compat(this);
        ivToolbarLeft.setVisibility(View.VISIBLE);
        tvToolbarTitle.setVisibility(View.VISIBLE);
        tvToolbarTitle.setText("测试控件");
    }

    @OnClick({R.id.iv_toolbar_left, R.id.bt_test_edit_input_vcode,
            R.id.bt_test_recycleviews, R.id.bt_test_activity_life,
            R.id.bt_test_activity_day_calendar, R.id.bt_test_activity_weibo_popuwindow
            , R.id.bt_test_share, R.id.bt_test_anim, R.id.bt_test_setting, R.id.bt_test_intentaction})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.iv_toolbar_left:
                onBackPressed();
                break;
            case R.id.bt_test_edit_input_vcode:
                intent = new Intent(TestActivity.this, InputVcodeViewActivity.class);
                startActivity(intent);
                break;
            case R.id.bt_test_recycleviews:
                intent = new Intent(TestActivity.this, RecycleviewsActivity.class);
                startActivity(intent);
                break;
            case R.id.bt_test_activity_life:
                intent = new Intent(TestActivity.this, AActivity.class);
                startActivity(intent);
                break;
            case R.id.bt_test_activity_day_calendar:
                intent = new Intent(TestActivity.this, TestDayCalendarActivity.class);
                startActivity(intent);
                break;
            case R.id.bt_test_activity_weibo_popuwindow:
                WeiBoMorePoPuWindow weiBoMorePoPuWindow = new WeiBoMorePoPuWindow(TestActivity.this);
                weiBoMorePoPuWindow.showMoreWindow(tvToolbarTitle, 10);
                break;
            case R.id.bt_test_share:
                String pakName = "";
                Intent intent = new Intent(Intent.ACTION_SEND); // 启动分享发送的属性
                intent.setType("text/plain"); // 分享发送的数据类型
                pakName = "com.tencent.mm";  //微信
                intent.setPackage(pakName);
                intent.putExtra(Intent.EXTRA_TEXT, "这里是分享内容"); // 分享的内容
                this.startActivity(Intent.createChooser(intent, ""));// 目标应用选择对话框的标题;
                break;
            case R.id.bt_test_anim:
                intent2Activity(TestAnimActivity.class);
                break;
            case R.id.bt_test_setting:
                intent2Activity(TestSettingActivity.class);
                break;
            case R.id.bt_test_intentaction:
                intent2Activity(TestIntentActionActivity.class);
//                IOsCheckView timePickerView = new IOsCheckView(this);
//                if (timePickerView != null && !timePickerView.isShowing()) {
//                    /**
//                     * 参数为你当前Activity或者Fragment的布局
//                     */
//                    timePickerView.showAtLocation(R.layout.activity_test);
//                }
                break;

        }
    }

}
